# coding: utf-8
# Author: Legend奇
# @Time： 2020/7/20 下午5:11
from tortoise import Model, fields


class MyAbstractBaseModel(Model):
    id = fields.IntField(pk=True)

    class Meta:
        abstract = True


class TimestampMixin(object):
    created_at = fields.DatetimeField(null=True, auto_now_add=True)
    modified_at = fields.DatetimeField(null=True, auto_now=True)


class NameMixin(object):
    name = fields.CharField(40, unique=True)
